FROM alpine:3

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
    && apk --no-cache add dnsmasq

COPY dnsmasq.conf /etc/dnsmasq.conf
COPY resolv.dnsmasq /etc/resolv.dnsmasq

VOLUME /dnsmasq.hosts

EXPOSE 53 53/udp

ENTRYPOINT ["dnsmasq", "-d"]